package com.wjs.blog.controller;

import com.wjs.blog.service.TagService;
import com.wjs.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tags")
public class TagsContorl {
    @Autowired
    TagService tagService;
    @GetMapping("/hot")
    public Result hottag(){
        int limit=6;
        return tagService.hot(limit);
    }
    @GetMapping
    public Result findAll(){
        return tagService.findAll();
    }
    @GetMapping("/detail")
    public Result findAllDetail(){
        return tagService.findAllDetail();
    }
    @GetMapping("/detail/{id}")
    public Result TagDetailByid(@PathVariable("id") long id){
        return tagService.TagDetailByid(id);
    }
}
